{% load i18n %}
{% load markup %}
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>
    {% if is_dev %}(dev){% endif %}
    {% block title %}{% endblock %} - Inhouse-Web
  </title>
  <meta name="description" content="">
  <meta name="author" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.png">
  <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css?v=1">
  <link rel="stylesheet" href="{{ STATIC_URL }}css/google.css">
  <script type="text/javascript"
          src="{% url django.views.i18n.javascript_catalog %}"></script>
  {% if is_dev %}
	<script type="text/javascript" src="{{ STATIC_URL}}closure/goog/base.js"></script>
	<script src="{{ STATIC_URL }}js/script.js?v=1"></script>
    <!-- Need this hack to use the debug toolbar -->
    <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
  {% else %}
	<script type="text/javascript" src="{{ STATIC_URL}}js/script.js.compiled?v=1"></script>
  {% endif %}
</head>
<body>
  <div id="help" style="display:none;">
	<table width="100%" cellpadding="0" style="border-bottom: 1px solid white;">
	  <tbody>
		<tr>
		  <td><h4>{% trans "Keyboard shortcuts" %}</h4></td>
		</tr>
	  </tbody>
	</table>
	<table cellpadding="0" width="100%" style="margin-top: 10px;">
	  <tbody>
		<tr>
	  <td>
		<table cellpadding="0" width="50%">
		  <tbody>
			<tr>
			  <th></th>
			  <th>{% trans "Navigation" %}</th>
			</tr>
			<tr>
			  <td class="shortcut"><span class="letter">g</span> {% trans 'then' %} <span class="letter">d</span> <b>:</b> </td>
			  <td>{% trans "Go to dashboard" %}</td>
			</tr>
            <tr>
			  <td class="shortcut"><span class="letter">g</span> {% trans 'then' %} <span class="letter">i</span> <b>:</b> </td>
			  <td>{% trans "Go to message inbox" %}</td>
			</tr>
			<tr>
			  <td class="shortcut"><span class="letter">g</span> {% trans 'then' %} <span class="letter">x</span> <b>:</b> </td>
			  <td>{% trans "Go to previous day" %}</td>
			</tr>
			<tr>
			  <td class="shortcut"><span class="letter">g</span> {% trans 'then' %} <span class="letter">c</span> <b>:</b> </td>
			  <td>{% trans "Go to current day" %}</td>
			</tr>
			<tr>
			  <td class="shortcut"><span class="letter">g</span> {% trans 'then' %} <span class="letter">v</span> <b>:</b> </td>
			  <td>{% trans "Go to next day" %}</td>
			</tr>
		  </tbody>
		</table>
	  </td>
	  <td>
		<table cellpadding="0" width="50%">
		  <tbody>
			<tr>
			  <th></th>
			  <th>{% trans "Timer" %}</th>
			</tr>
			<tr>
			  <td class="shortcut"><span class="letter">+</span> <b>:</b> </td>
			  <td>{% trans "Add a new timer" %}</td>
			</tr>
		  </tbody>
		</table>
	  </td>
		</tr>
	  </tbody>
	</table>
  </div>

  <div id="container">
	{% if messages %}
	  <div class="wrapper">
        <div class="message-box">
		<ul id="messages">
			{% for message in messages %}
				<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>
				  {{ message|markdown }}
				</li>
			{% endfor %}
		</ul>
		</div>
	  </div>
	{% endif %}
    <header>
      <div id="liner">
        <div id="logo">
          Inhouse-Web
        </div>
        <div style="width: 100%; text-align: right; float: top; border-bottom: 1px solid #C9D7F1;">
          {% if user.id %}
	    <div style="padding: 5px;">
	      {% if user.email and user.username %}
                <strong>{{ user.email }}</strong>
	      {% else %}
			<strong>{{ user.username }}</strong>
		  {% endif %}|
            <a href="{% url inhouse.views.edit_profile %}">{% trans "Profile" %}</a> |
            <a href="/settings">{% trans "Settings" %}</a> |
            <a href="{% url django.contrib.auth.views.logout %}">{% trans "Sign out" %}</a>
	    </div>
          {% endif %}
        </div>
      </div>
    </header>

    <div id="main">
	  <nav id="main-navigation">
	  {% block navigation %}
	  <ul>
		{% if user.id %}
		  <li><a href="{% url inhouse.views.dashboard %}" class="tab{% ifactivetab "main" "dashboard" %} active{% endifactivetab %}">{% trans "Dashboard" %}</a></li>
		  <li><a href="{% url inhouse.views.time %}" class="tab{% ifactivetab "main" "time" %} active{% endifactivetab %}">{% trans "Time tracking" %}</a></li>
		  <li><a href="/projects" class="tab{% ifactivetab "main" "projects" %} active{% endifactivetab %}">{% trans "Projects" %}</a></li>
		  <li><a href="/issues" class="tab{% ifactivetab "main" "issues" %} active{% endifactivetab %}">{% trans "Issues" %}</a></li>
		  <li><a href="/company" class="tab{% ifactivetab "main" "company" %} active{% endifactivetab %}">{% trans "Company" %}</a></li>
		  {% if user.is_superuser or user.is_staff %}
			<li><a href="/admin" target="_blank">{% trans "Administration" %}</a></li>
		  {% endif %}
		{% else %}
		  <li><a href="/">{% trans "Login" %}</a></li>
		{% endif %}
	  </ul>
	  {% endblock %}

	  <form id="searchform" method="get" action="/search">
		<input class="search" id="q" type="text" name="q">
		<script type="text/javascript">
		  var s = new goog.ui.LabelInput("{% trans 'Search' %}");
		  s.decorate(goog.dom.getElement('q'));
		</script>

	  </form>

	</nav>

	<nav id="sub-navigation">
      {% block sub-navigation %}{% endblock %}
    </nav>

	<section id="actions">
	  {% block actions %}{% endblock %}
	</section>

	<section id="intro">
	  <h1 style="padding: 5px; margin-right: 10px; margin-left: 10px;">
        {% block page-title %}{% endblock %}
      </h1>
	</section>

	<section id="content">
	  <aside id="left">
		<p>
		  {% if user.id %}
		    {% include "calendar.html" %}
			{% include "timer.html" %}
		  {% endif %}
		  {% block sidebar %}{% endblock %}
		</p>
	  </aside>
	  <section id="main-content">
		{% if form.errors %}
		  {{ form.errors }}
		{% endif %}
		{% block content %}{% endblock %}
	  </section>
	</section>
    </div>
    <footer>
	  {% include "footer.html" %}
    </footer>
  </div> <!--! end of #container -->
  <script>
	var help_displayed = false;
	inhouse.shortcuts.init_handler();
  </script>
  <!--[if lt IE 7 ]>
    <script src="js/libs/dd_belatedpng.js"></script>
    <script> DD_belatedPNG.fix('img, .png_bg'); </script>
  <![endif]-->
</body>
</html>
